/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.imenu.ejb;

import com.imenu.entity.ImenuOrder;
import com.imenu.entity.ImenuOrderItem;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Yunzi
 */
@Stateless
public class ImenuOrderItemFacade extends AbstractFacade<ImenuOrderItem> {
    @PersistenceContext(unitName = "iMenuPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public ImenuOrderItemFacade() {
        super(ImenuOrderItem.class);
    }
    public List<ImenuOrderItem> findByOrderId(ImenuOrder order) {
        return getEntityManager().createNamedQuery("ImenuOrderItem.findByOrderId").setParameter("orderId", order).getResultList();
    }
    
}
